package com.gsbelarus.gedemin.salary.entity.model;

import com.google.gson.annotations.Expose;

import io.realm.RealmObject;
import io.realm.annotations.Ignore;
import io.realm.annotations.PrimaryKey;

// {"uid":"1234567890","gdMsgKey":"1234567890","statusIndex":0}

public class SyncGdMsgStateModel extends RealmObject {

    public enum UpdatedStatus {READED, DELETED}

    @PrimaryKey
    @Expose
    private String uid;
    @Ignore
    private UpdatedStatus status;
    @Expose
    private int statusIndex;
    @Expose
    private int gdMsgKey;

    public UpdatedStatus getStatus() {
        return UpdatedStatus.values()[getStatusIndex()];
    }

    public void setStatus(UpdatedStatus status) {
        setStatusIndex(status.ordinal());
    }

    // generated getters & setters

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public int getGdMsgKey() {
        return gdMsgKey;
    }

    public void setGdMsgKey(int gdMsgKey) {
        this.gdMsgKey = gdMsgKey;
    }

    public int getStatusIndex() {
        return statusIndex;
    }

    public void setStatusIndex(int statusIndex) {
        this.statusIndex = statusIndex;
    }
}
